home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er Special 12
/
64er_Magazin_Sonderheft_12_86-12_1986_Markt__Technik_de_Side_A.d64
/
move-demo 2
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
417b
|
25 lines
100 rem *****************
110 rem *** move-demo ***
120 rem *sortierte liste*
130 rem *****************
140 :
150 am=100
155 dim a$(am)
160 print chr$(147)
167 ad=ad+1
170 input"datensatz";da$
180 s=0:e=ad:gosub 510:rem bi-suche
190 sys 49152,a$(e),a$(e+1),(am-e)*3
200 a$(e)=da$
215 print:print
217 for i=1 to ad:print a$(i):next
220 goto 167
230 :
240 :
500 rem *** binaere suche ***
510 m=int((s+e)/2)
520 if da$>a$(m) then s=m:goto 540
530 e=m
540 if e-s>1 then gosub 510
550 return